package com.itheima.stock.job;

import com.itheima.stock.service.StockTimerTaskService;
import com.xxl.job.core.handler.annotation.XxlJob;
import groovy.transform.AutoClone;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 定义股票相关数据的定时任务
 * @author laofang
 */
@Component
public class StockJob {
    @Autowired
    private StockTimerTaskService service;

    @XxlJob("jobTest")
    public void jobTest(){
        System.out.println("jobTest run.....");
    }

    // 获取国内大盘数据
    @XxlJob("getInnerMarketInfo")
    public void getInnerMarketInfo() {
        service.getInnerMarketInfo();
    }

    // 获取A股数据
    @XxlJob("getStockInfos")
    public void getStockInfos() {
        service.getStockRtIndex();
    }

    // 获取板块数据
    @XxlJob("getStockBlockInfoTask")
    public void getStockBlockInfoTask() {
        service.getStockSectorRtIndex();
    }

}